package com.cloud.basic.lambda;

import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
 * @program: basic
 * @description:
 * @author: Cloud
 * @create: 2020/10/26 10:09:48
 */
public class testList {

    public static void main(String[] args) {
        //        ArrayList<String> objects = Lists.newArrayList();
//        objects.add("测试1");
//        objects.add("测试2");
//        objects.add("测试3");
//        String join = String.join(",", objects);
//        System.out.println(join);
//        List<String> list = Arrays.asList("WORK1545-2", "WORK1512", "WORK1", "WORK741");
//        List<String> list1 = Arrays.asList("WORK1545","741");
//        List<String> collect = list.stream().filter(a -> list1.toString().contains(a)).collect(Collectors.toList());
//        System.out.println(collect);
//        Map<String, List<String>> collect = list.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.toList()));
//        System.out.println(collect);

        //集合一
        List<String> list1=new ArrayList<String>();
        list1.add("11");
        list1.add("12");
        list1.add("13");
        //集合二
        List<String> list2=new ArrayList<String>();
        list2.add("12");
        list2.add("15");
        list2.add("16");
        List<String> existList1=new ArrayList<String>(list1);
        List<String> existList2=new ArrayList<String>(list2);
        existList1.removeAll(list2);
        existList2.removeAll(list1);

        System.out.println("existList1 = " + existList1);
        System.out.println("existList2 = " + existList2);
    }
}
